package com.mage.completeproject.service.impl;

import com.mage.completeproject.bean.Department;
import com.mage.completeproject.bean.Employee;
import com.mage.completeproject.mapper.DepartmentMapper;
import com.mage.completeproject.mapper.EmployeeMapper;
import com.mage.completeproject.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    EmployeeMapper employeeMapper;

    @Autowired
    DepartmentMapper departmentMapper;

    @Override
    public List<Employee> getEmpAll(){
        return employeeMapper.getEmpAll();
    }

    @Override
    public List<Department> getDeptAll(){
        return departmentMapper.getDeptAll();
    }

    @Override
    public void insertEmp(Employee employee){
        employeeMapper.insertEmp(employee);
    }

    @Override
    public Employee getEmpById(Integer id){
        return employeeMapper.getEmpById(id);
    }
    @Override
    public void updateEmp(Employee employee){
        employeeMapper.updateEmp(employee);
    }

    @Override
    public void deleteEmpById(Integer id){
        employeeMapper.deleteEmpById(id);
    }
}
